﻿/*------------------------------------------------
// File Description: LoadInspect DataBase Entity
// Author:			 Crane
// Create Time:		 2020-06-16 11:31:39
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 装车检
    /// </summary>
    [Table(nameof(LoadInspect))]
    public class LoadInspect : BaseEntity
    {
        private string _cabinetNo = string.Empty;
        private string _driver;
        private string _phone;
        private string _numberPlate;
        private string _actualCabinetNo;
        private string _lockNo;
        private string _deliveryNo;

        #region Public Property

        /// <summary>
        /// 发货单号
        /// </summary>
        public string DeliveryNo
        {
            get { return string.IsNullOrWhiteSpace(_deliveryNo) ? string.Empty : _deliveryNo; }
            set { _deliveryNo = value; }
        }

        ///<Summary>
        /// 柜号
        ///</Summary>
        public string CabinetNo
        {
            get { return string.IsNullOrWhiteSpace(_cabinetNo) ? string.Empty : _cabinetNo; }
            set { _cabinetNo = value; }
        }

        ///<Summary>
        /// 装车状态
        ///</Summary>
        public Enum.LoadStatus LoadStatus { get; set; }

        ///<Summary>
        /// 数量
        ///</Summary>
        public int Quantity { get; set; }

        ///<Summary>
        /// 已装车数量
        ///</Summary>
        public int LoadedQuantity { get; set; }

        /// <summary>
        /// 司机
        /// </summary>
        public string Driver
        {
            get { return string.IsNullOrWhiteSpace(_driver) ? string.Empty : _driver; }
            set { _driver = value; }
        }

        /// <summary>
        /// 联系方式
        /// </summary>
        public string Phone
        {
            get { return string.IsNullOrWhiteSpace(_phone) ? string.Empty : _phone; }
            set { _phone = value; }
        }

        /// <summary>
        /// 车牌号
        /// </summary>
        public string NumberPlate
        {
            get { return string.IsNullOrWhiteSpace(_numberPlate) ? string.Empty : _numberPlate; }
            set { _numberPlate = value; }
        }

        /// <summary>
        /// 真实柜号
        /// </summary>
        public string ActualCabinetNo
        {
            get { return string.IsNullOrWhiteSpace(_actualCabinetNo) ? string.Empty : _actualCabinetNo; }
            set { _actualCabinetNo = value; }
        }

        /// <summary>
        /// 锁号
        /// </summary>
        public string LockNo
        {
            get { return string.IsNullOrWhiteSpace(_lockNo) ? string.Empty : _lockNo; }
            set { _lockNo = value; }
        }

        ///<Summary>
        /// 装车人
        ///</Summary>
        public int LoadBy { get; set; }

        ///<Summary>
        /// 完成时间
        ///</Summary>
        public DateTime? FinishTime { get; set; }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 装车检
        /// </summary>
        public virtual DbSet<LoadInspect> LoadInspects { get; set; }
    }
}